<?php
namespace PragmaWeb\MainBundle\Util;

use Symfony\Component\Serializer\Encoder\JsonEncode;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;


class jsonEncoder
{
	public static function encode($object)
	{
		$encoders = array(new JsonEncode());
		$normalizers = array(new GetSetMethodNormalizer());
		$serializer = new Serializer($normalizers, $encoders);
		
		return $serializer->serialize($object, 'json');
	}
}